﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>Index</title>
        @if (false)
    {
        <script src="../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <link href="@Url.Content("~/Content/jquery-ui.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/json2.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/jquery-ui.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/regex.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)
<script>
    $(document).ready(function () {
        $("#toolMenu").smartFloat();
        var hdjsAlert = $("#e").val();
        if (hdjsAlert != "") {
            alert(hdjsAlert);
        }
       
    });

    window.onresize = function () { $("#content").attr("height", parent.document.body.clientHeight - 100); }
    function search() {
        $("#hidissueID").val(issueID.GetText());
        $("#content").attr("src", rootPath + '/AllowanceIssueSummarySheet/JSummarySheet?issueID=' + issueID.GetText());

        $.ajax({
            type: 'POST',
            url: rootPath + '/AllowanceIssueSummarySheet/GetWCQK',
            data: { issueID: issueID.GetText() },
            success: function (result) {
                document.getElementById('WCQK').innerHTML = result;
            }
        });

    }

    function MenuTop_emClick(source, e) {
        switch (e.item.name) {
            case "btnSave":
                {
                    if ($("#hidissueID").val() != "") {
                        form1.submit();
                    }
                    else {
                        alert("请选择期号！");
                    }
                    break;
                }
            case "btnReport":
                {
                    document.frames["content"].focus();
                    document.frames["content"].print();
                   
                    break;
                }

        }
    }

    function keyPress() {
        if (event.keyCode && event.keyCode == 13) {
            search();
        }
    }
</script>
</head>
<body onkeypress="keyPress()">
 @using (Html.BeginForm("ToExecl", "AllowanceIssueSummarySheet", FormMethod.Post, new { id = "form1" }))
 {
     
@Html.Hidden("hidissueID", "")
@Html.Hidden("e", ViewData["e"])
 }
 @Html.DevExpress().Menu(settings =>
{
    settings.Name = "toolBarMenu";
    settings.ItemAutoWidth = false;
    settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
    settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
    settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
    settings.Items.Add(item =>
    {
        item.Name = "btnSave";
        item.Text = "导出Excel";
        item.Image.Url = Url.Content("~/Content/ControlImages/import.png");
    });

    settings.Items.Add(item =>
    {
        item.Name = "btnReport";
        item.Text = "打印";
        item.Image.Url = Url.Content("~/Content/icons/print.png");
    });
    settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
    settings.ItemLinkMode = ItemLinkMode.ContentBounds;
}).GetHtml()
    <div>
        <table width="100%" >
        <tr >
        <td align="center">
        <table><tr>
        <td >
        期号:
        </td>
        <td>
        @Html.DevExpress().TextBox(settings =>
   {
       settings.Name = "issueID";
       settings.Width = 150;

   }).GetHtml()
        </td>
        <td>
 @Html.DevExpress().Button(settings =>
{
    settings.Name = "btnSearch";
    settings.Text = "查询";
    settings.ControlStyle.CssClass = "button";
    settings.Images.Image.Url = Url.Content("~/Content/ControlImages/search.png");
    settings.ClientSideEvents.Click = "search";
}).GetHtml()
        </td>
        <td id="WCQK">
        </td>
        </tr></table>
        </td>
        </tr>
        </table>
     <div>
     <iframe  id='content' name='content' style='width:100%' frameborder='0' src=''></iframe>
     </div>
    </div>
</body>
</html>
